import storage from '@/utils/storage';
import router from '@/router';
import { ElMessageBox } from 'element-plus';


export default {
    mounted(el, binding) {
        el.onclick = function (e) {
            e.stopPropagation()
            if (!storage.getStorage('token')) {
                ElMessageBox.confirm(
                    '此功能需要登录',
                    '提示',
                    {
                        confirmButtonText: '确认',
                        showCancelButton: false,
                        type: 'warning',
                        showClose: false,
                        closeOnClickModal: false
                    }
                ).then(() => {
                    router.push('/login')
                })

            }

        }
    }

}
